// JavaScript Document
$(document).ready(function(){
	$('a.fotoLink[href^=#]').click(function() {
		var popURL = $(this).attr('href');
		
		popURL.replace(/#/g,'');
		
		alert("sizeof:"+popURL.length);
		
		var dataString = "foto="+popURL;
		
		alert("this is the popURL " + popURL + " dataString " + dataString);
		
		$("#fotoGrandeBox").empty();
		
		$.ajax({
			   type: "GET",
			   url: "/getFoto.php",
			   data: dataString,
			   cache: false,
			   success: function(html){
				   alert("this is html "+html+" damn!");
				   $("#fotoGrandeBox").append(html);
				}			
		});
		
		alert("so nothing happenned?");
	});
	
	$(".fotitoBox").click(function(){
		var fid = $(this).attr("id");		
		
		var dataString = "foto="+fid;
		
		$("#fotoGrandeBox").empty();
		
		$.ajax({
			   type: "GET",
			   url: "/getFoto.php",
			   data: dataString,
			   cache: false,
			   success: function(html){
				   $("#fotoGrandeBox").fadeIn('slow');
				   $("#fotoGrandeBox").append(html);
				}			
		});
	});
});